//
//  FavoriteViewController.m
//  ios_news
//
//  Created by Han on 14-7-22.
//  Copyright (c) 2014年 ucoder. All rights reserved.
//

#import "DeclarationViewController.h"

@implementation DeclarationViewController




- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.navigationController.navigationBarHidden = NO;
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.barTintColor = MAIN_COLOR;
    self.navigationController.navigationBar.translucent = NO;  // 半透明
    
    self.navigationItem.title = @"声明条款";
    self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
    [self addButton];

    
    
    
    UIImageView *imageView = [[UIImageView alloc]init];
    [imageView setImage:[UIImage imageNamed:@"declaration_img"]];
    //  [imageView setBackgroundColor:[UIColor redColor]];
    imageView.center = CGPointMake(self.view.frame.size.width*0.5, self.view.frame.size.height*0.5 - 150);
    imageView.bounds = CGRectMake(0, 0, 224, 102);
    [self.view addSubview:imageView];
}

//添加按钮
-(void)addButton
{
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftButton.exclusiveTouch = YES;
    leftButton.frame = CGRectMake(0, 0, 44, 44);
    //button.backgroundColor = [UIColor redColor];
    
    [leftButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    leftButton.imageEdgeInsets = UIEdgeInsetsMake(0, -30, 0, 0);
    
    [leftButton addTarget:self action:@selector(backButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftButton];
    self.navigationItem.leftBarButtonItem = leftButtonItem;
    
}

-(void)backButtonClicked:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}




@end
